package com.maimao.core.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class WebConfig extends WebMvcConfigurationSupport {

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        //添加自定义的拦截器
//        registry.addInterceptor(new ThreadLocalInterceptor()).addPathPatterns("/**");

        //todo 对于 xid 传递丢失的情况，需要添加以下拦截器，这里因为在 core 包所以没有依赖，后面可以挪到各个微服务中
        //registry.addInterceptor(new SeataHandlerInterceptor()).addPathPatterns("/**");

    }
}

